Refactoring of LIR serializer and exposing pipeline metrics#10561
Refactoring of LIR serializer and exposing pipeline metrics#10561cachedout merged 18 commits intoelastic:masterfrom
Conversation
yaauie
left a comment
There was a problem hiding this comment.
In general, this looks sensible and complies with our intent. Yay for bringing more code over into the OSS-license.
x-pack/lib/monitoring/inputs/metrics/state_event/lir_serializer.rb
Outdated
Show resolved
Hide resolved
|
jenkins test this again please |
|
Tests are all fixed up now. :) @yaauie and @ycombinator This is ready for a re-review please. |
|
Looking at the response from the API (using this PR), I see this structure: {
...,
"pipelines": {
"main": {
"graph": {
"hash": "...",
"type": "lir",
"version": "...",
"graph": {
"vertices": { ... },
"edges": { ... }
}
}
}
}
}How difficult would it be to rename the outer |
|
@ycombinator Sadly, this isn't trivial. I think it would be better to change this on the beats side. |
ycombinator
left a comment
There was a problem hiding this comment.
Functionally LGTM. I'll defer to Logstash team folks for the code review. Thanks!
|
@cachedout I just noticed that while this PR does indeed implement the requirements of #10119 (to expose additional fields for a pipeline via the Personally I'm okay with that but it could potentially make the API response quite heavy, if there are several pipelines being run on a node. I'm not sure if it would be desirable to keep the |
|
jenkins, test this |
|
@cachedout I just noticed this point in a comment from @jsvd on the issue for this PR:
If its not a lot of work, could we implement this as part of this PR as well? |
| def resolve_cluster_uuids | ||
| cluster_uuids = [] | ||
| outputs.each do |output| | ||
| if LogStash::SETTINGS.registered?(output.id + ".cluster_uuid") |
There was a problem hiding this comment.
Would you mind pointing me to the place where these settings are dynamically registered? I'm not finding cluster_uuid anywhere on current master.
IIRC, LogStash::SETTINGS#validate_all will cause a failure when a setting is provided in the yaml or at command-line and the relevant setting has not been registered.
There was a problem hiding this comment.
@yaauie Certainly. This requires a little bit of background knowledge on a discussion that @jsvd had. The setting is registered by the Elasticsearch plugin. The PR which introduces this functionality is here: logstash-plugins/logstash-output-elasticsearch#857
That said, it's totally possible that I don't fully grok how settings should be registered so if this is not the correct manner for doing so, I'd appreciate any advice. Thanks!
There was a problem hiding this comment.
As discussed in other threads, I consider routing through LogStash::SETTINGS to stash plugin metadata to be a hack, and while it can be made to work I'd much rather provide you with the tools you need to support this feature in a way that is less fragile.
- PR introducing
Plugin#plugin_metadataand the metadata registry is adds LogStash::PluginMetadata for simple key/value plugin metadata #10636 - Notes about implementing on top of my PR are on your other PR
|
I tested this PR along with logstash-plugins/logstash-output-elasticsearch#857, and all works as expected. The Having BTW, similar to the cluster_uuid lookup enhancement you've done for the Elasticsearch output plugin in logstash-plugins/logstash-output-elasticsearch#857, we'll need to enhance the Elasticsearch filter and input plugins as well. This way we can associate the Logstash pipeline/node with any Elasticsearch clusters it touches in the Stack Monitoring UI. I would not consider these further enhancements as a blocker for this PR here. |
|
@ycombinator The parameter to display the graph is now added. Because the key in the return is called |
Thanks @cachedout. I noticed that this parameter works as expected on |
ycombinator
left a comment
There was a problem hiding this comment.
Functionally LGTM. Just re-tested this PR with and without graph=true query parameter on both GET _node/pipelines and GET _node/pipelines/:id calls. All combinations work as expected.
|
@danhermann Yes, I agree that this approach is sub-optimal, though doing it a different way potentially required some changes to Logstash that I wasn't comfortable making. Are you all right with us getting this in and re-visiting those concerns in a follow-up PR? |
There was a problem hiding this comment.
I retested this PR, along with elastic/beats#11506 and it works as expected. Still LGTM!
Nice work @cachedout and thanks @danhermann, @yaauie, and @jsvd for the reviews ❤️.
|
Hi folks it seems this change introduces a new warning during startup: @danhermann should we add the Ruby Array to LazyDelegatingGauge.java? |
|
The Ruby types that are currently wrapped for metrics ( |
|
@danhermann since this is a new metric, should we just replace it with a java type then before it ships in a release? |
|
@jsvd, that's what I would suggest. |
This PR closes #10119
It incorporates the following changes:
Refactors the LIR serializer out of x-pack and into OSS. Discussion issue: https://github.com/elastic/dev/issues/1165
Pulls the
pluginslist out of the current monitoring document (and the new API)Provides remaining functionality outlined in Enhance GET _node/pipelines/:id API for Metricbeat monitoring #10119